﻿using CommonMethod;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = "RLLR";
            int c = 0;
            int res = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i].Equals('L'))
                {
                    c++;
                }
                else
                {
                    c--;
                }
                if (c==0)
                {
                    res++;
                }
            }
            Console.WriteLine(res);
            Console.ReadKey();

        }
    }
    class student
    {
        public string Name { get; set; }
    }
   

}
